﻿@using Aspire.Dashboard.Resources
@using Aspire.Dashboard.Model
@namespace Aspire.Dashboard.Components
@inject IStringLocalizer<Columns> Loc

@if (_unviewedCount > 0)
{
    <FluentAnchor aria-label="@(_unviewedCount == 1 ? nameof(Columns.UnreadLogErrorsBadgeOneErrorLog) : string.Format(Loc[nameof(Columns.UnreadLogErrorsBadgeErrorLogs)], _unviewedCount))"
                  Href="@GetResourceErrorStructuredLogsUrl()"
                  Appearance="Appearance.Stealth"
                  Class="unread-logs-errors-link"
                  @onclick:stopPropagation="true">
        <FluentBadge
            Appearance="Appearance.Accent"
            Circular="true"
            Fill="error"
            Color="var(--unread-logs-badge-color)">
            @(_unviewedCount > 9 ? "9+" : _unviewedCount.ToString())
        </FluentBadge>
    </FluentAnchor>
}
